<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css"></style>
</head>
<body>
    <h1>JS 数组</h1>
    <hr>

    <script>
        var list = ['艳艳', '静静', '哈哈', '翠翠', '花花', '草草', '甜甜'];

        // for
        for (var i = 0; i < list.length; i++) {
            document.write(i + ' : ' + list[i] + '<br>');
        }

        document.write('<hr>');

        // for in
        for (var i in list) {
            document.write(i + ' : ' + list[i] + '<br>');
        }

        document.write('<hr>');

        var obj = {name: '源氏', age: 38, sex: '男的'};
        for (var i in obj) {
            document.write(i + ':' +  obj[i] + '<br>');
        }
        

    </script>
</body>
</html>